package com.amado.course27.service.impl;

import com.amado.course27.entity.Goods;
import com.amado.course27.service.GoodsService;

public class GoodsServiceFileImpl implements GoodsService{
	public Goods[] goodsArray = new Goods[100];
	public int goodsCount= 0;
	@Override
	public Goods getGoods(String goodsCode) {
		return null;
	}
	@Override
	public void addGoods(Goods goods) {
		goodsArray[goodsCount++] = goods;
	}
	@Override
	public void updateGoods(Goods goods) {
		if(goods==null){
			return;
		}
		Goods returnGoods = getGoods(goods.getGoodsCode());
		if(returnGoods==null){
			System.out.println("不存在");
		}else{
			returnGoods.setName(goods.getName());
			returnGoods.setPrice(goods.getPrice());
		}
	}

	@Override
	public boolean deleteGoods(String goodsCode) {
		return false;
	}

	@Override
	public Goods[] listGoods() {
		return new Goods[0];
	}

	@Override
	public Goods[] listGoods(String goodsName) {
		return new Goods[0];
	}
}
